package codec

import (
	"encoding/json"
	"github.com/xcy8712622040/gnetws"
	"io"
)

type JsonSerialize struct{}

func NewJsonSerialize() *JsonSerialize {
	return new(JsonSerialize)
}

func (j *JsonSerialize) NewEnCodec(w io.Writer) gnetws.Encode {
	return json.NewEncoder(w)
}

func (j *JsonSerialize) NewDeCodec(r io.Reader) gnetws.Decode {
	return json.NewDecoder(r)
}
